home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7425 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  646 b 

  1. Path: osuunx.ucc.okstate.edu!kakani
  2. From: kakani@osuunx.ucc.okstate.edu (Madhav Kakani)
  3. Newsgroups: comp.lang.c++
  4. Subject: How to generate all the combinations of n numbers?
  5. Date: 22 Feb 1996 23:31:21 GMT
  6. Organization: Oklahoma State University, Stillwater OK
  7. Message-ID: <4giuc9$pq@news.cis.okstate.edu>
  8. NNTP-Posting-Host: osuunx.ucc.okstate.edu
  9.  
  10. Hello everybody,
  11.     I am having problems in writing a c/c++ program which
  12. generates all possible combinations of n given numbers.
  13. For example, if an array x has some numbers
  14.  
  15. int x[] = {1,2,3};
  16.  
  17. the program should generate the following output:
  18. 1
  19. 2
  20. 3
  21. 12
  22. 13
  23. 23
  24. 123
  25.  
  26. Thanks in advance,
  27.                     -madhav
  28.  
  29.